/*
 * @Author: funlee
 * @Email: i@funlee.cn
 * @Date: 2018-01-10 23:06:14
 * @Last Modified time: 2018-01-10 23:06:14
 * @Description: 直线 
 */
window.onload = function () {
  var canvas = document.querySelector('.canvas')
  var ctx = canvas.getContext('2d')

  ctx.strokeStyle = 'red'
  ctx.lineWidth = 4
  ctx.moveTo(50, 100)
  ctx.lineTo(150, 50)
  ctx.lineTo(150, 100)
  ctx.lineTo(50, 100)
  ctx.stroke()

  console.log(canvas.toDataURL())
  console.log(canvas.width)
  console.log(canvas.height)
}